package a.i;

import java.util.Random;

public class wb
  extends Random
{
  public static boolean a;
  
  public wb() {}
  
  public wb(long paramLong)
  {
    super(paramLong);
  }
  
  public int nextInt(int paramInt)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    if (!bool2) {
      if (paramInt <= 0) {
        throw new IllegalArgumentException("n must be positive");
      }
    }
    int i = next(31);
    int j = i % paramInt;
    do
    {
      if (i - j + (paramInt - 1) < 0) {
        break;
      }
    } while (bool1);
    return j;
  }
  
  public int[] a(int paramInt1, int paramInt2, int paramInt3)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    paramInt3--;
    int[] arrayOfInt2 = null;
    int i = paramInt3 - paramInt2 + 1;
    if (((bool2) || (i >= paramInt1)) && ((bool2) || (paramInt1 > 0)))
    {
      int[] arrayOfInt1 = new int[i];
      arrayOfInt2 = new int[paramInt1];
      int k = 0;
      int m = paramInt2;
      do
      {
        do
        {
          if (k >= i) {
            break;
          }
          arrayOfInt1[k] = m;
          k++;
          m++;
          if (bool2) {
            break label107;
          }
          if (bool1) {
            break label103;
          }
        } while (!bool1);
      } while (bool2);
      k = 0;
      label103:
      label107:
      m = i - 1;
      do
      {
        if (k >= paramInt1) {
          break;
        }
        int j = nextInt(m + 1);
        if ((!bool2) && (bool1)) {
          break label180;
        }
        arrayOfInt2[k] = arrayOfInt1[j];
        if (!bool2)
        {
          if (j < m) {
            arrayOfInt1[j] = arrayOfInt1[m];
          }
          k++;
          m--;
        }
      } while (!bool1);
    }
    label180:
    return arrayOfInt2;
  }
  
  public boolean[] a(int paramInt1, int paramInt2)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    if (paramInt2 > paramInt1) {
      throw new RuntimeException("YRandom.getBoolArray( " + paramInt1 + ", " + paramInt2 + " )");
    }
    int[] arrayOfInt = a(paramInt2, 0, paramInt1);
    boolean[] arrayOfBoolean = new boolean[paramInt1];
    if (arrayOfInt != null)
    {
      int i = 0;
      do
      {
        if (i >= arrayOfInt.length) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label111;
        }
        arrayOfBoolean[arrayOfInt[i]] = true;
        i++;
      } while (!bool1);
    }
    label111:
    return arrayOfBoolean;
  }
  
  public int[] b(int paramInt1, int paramInt2)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    int[] arrayOfInt = new int[paramInt1];
    int i = 0;
    do
    {
      while (!bool1)
      {
        if (i >= paramInt2) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label59;
        }
        arrayOfInt[nextInt(arrayOfInt.length)] += 1;
        i++;
      }
    } while (bool2);
    label59:
    return arrayOfInt;
  }
  
  public double a(double paramDouble1, double paramDouble2)
  {
    return nextDouble() * (paramDouble2 - paramDouble1) + paramDouble1;
  }
  
  public int c(int paramInt1, int paramInt2)
  {
    return nextInt(paramInt2 - paramInt1) + paramInt1;
  }
  
  public void a(Object[] paramArrayOfObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    int i = 0;
    int j;
    Object localObject;
    do
    {
      do
      {
        if (i >= paramArrayOfObject.length) {
          break;
        }
        j = nextInt(paramArrayOfObject.length);
        localObject = paramArrayOfObject[i];
        paramArrayOfObject[i] = paramArrayOfObject[j];
        paramArrayOfObject[j] = localObject;
        i++;
        if (bool2) {
          break label70;
        }
        if (bool1) {
          break label69;
        }
      } while (!bool1);
    } while (bool2);
    i = paramArrayOfObject.length - 1;
    label69:
    label70:
    do
    {
      if (i < 0) {
        break;
      }
      j = nextInt(paramArrayOfObject.length);
      localObject = paramArrayOfObject[i];
      paramArrayOfObject[i] = paramArrayOfObject[j];
      paramArrayOfObject[j] = localObject;
      i--;
    } while (!bool1);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.i.wb
 * JD-Core Version:    0.7.0.1
 */